package org.noote.libs.sogle;

import java.util.Vector;

import javax.microedition.khronos.opengles.GL10;

public class Object3D_Group extends Object3D {
	private Vector<Object3D> children = new Vector<Object3D>();
	
	@Override
	protected void _drawElement(GL10 gl) {
		int size = children.size();
		for( int i = 0; i < size; i++)
			children.get(i).draw(gl);
	}

	/**
	 * @param location
	 * @param object
	 * @see java.util.Vector#add(int, java.lang.Object)
	 */
	public void add(int location, Object3D object) {
		children.add(location, object);
	}

	/**
	 * @param object
	 * @return
	 * @see java.util.Vector#add(java.lang.Object)
	 */
	public boolean add(Object3D object) {
		return children.add(object);
	}

	/**
	 * 
	 * @see java.util.Vector#clear()
	 */
	public void clear() {
		children.clear();
	}

	/**
	 * @param location
	 * @return
	 * @see java.util.Vector#get(int)
	 */
	public Object3D get(int location) {
		return children.get(location);
	}

	/**
	 * @param location
	 * @return
	 * @see java.util.Vector#remove(int)
	 */
	public Object3D remove(int location) {
		return children.remove(location);
	}

	/**
	 * @param object
	 * @return
	 * @see java.util.Vector#remove(java.lang.Object)
	 */
	public boolean remove(Object object) {
		return children.remove(object);
	}

	/**
	 * @return
	 * @see java.util.Vector#size()
	 */
	public int size() {
		return children.size();
	}
}
